#include "widget.h"
#include "ui_widget.h"

#include <QDebug>
#include <QFontDialog>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton, &QPushButton::clicked, [](){
        bool flag;
        QFont f = QFontDialog::getFont(&flag);
        qDebug() << f << f.family() << f.bold() << f.weight() << f.italic() << f.pointSize();
    });

    connect(ui->pushButton_2, &QPushButton::clicked, [](){
        bool flag;
        QFont f("微软雅黑", 14, 75, true);
        QFont result = QFontDialog::getFont(&flag, f);
    });
}

Widget::~Widget()
{
    delete ui;
}
